#!/usr/bin/python3
# coding=utf-8
#
# Copyright (C) 2023-2024. Huawei Technologies Co., Ltd. All rights reserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# ===============================================================================

import numpy as np
import torch

def sigmoid(x):
    return 1 / (1 + np.exp(-x))
    # return np.exp(x) / (1 + np.exp(x))


def gen_golden_data():
    input_x = np.random.uniform(-3, 3, [8, 2048]).astype(np.float16)
    # golden = sigmoid(input_x)
    golden = torch.sigmoid(torch.tensor(input_x))
    golden = golden.numpy()

    input_x.tofile("./input/input_x.bin")
    golden.tofile("./output/golden.bin")


if __name__ == "__main__":
    gen_golden_data()
